standardError": "" が表示される原因を教えてください

standardError": "" が表示される原因を教えてください

Clock Icon2024.08.09

困っていること

起動中 Linux OS の EC2 インスタンスにおいて、amazon-ssm-agent: "standardError": "" と Error が含まれるログ出力を確認しました。
当該メッセージが出力される原因を教えてください。

どう対応すればいいの?

当該メッセージは、何らかのエラーを示すものではございません。
こちらは、Amazon Inspector の有効化を契機にエラーメッセージが出力されます。
当該サービスを有効化すると、EC2 インスタンスへ関連付けの名前: InspectorDistributor-do-not-delete として、ドキュメント名: AmazonInspector2-ConfigureInspectorSsmPlugin を関連付けしします。

無題

https://docs.aws.amazon.com/ja_jp/inspector/latest/user/windows-scanning.html

  1. Amazon EC2 スキャンがアクティブ化になると、Amazon Inspector は Windows リソースに対して新しい SSM 関連付け InspectorDistributor-do-not-delete、InspectorInventoryCollection-do-not-delete および InvokeInspectorSsmPlugin-do-not-delete を作成します。
  2. InspectorDistributor-do-not-delete SSM 関連付けはAWS-ConfigureAWSPackage、SSM ドキュメントと AmazonInspector2-InspectorSsmPluginSSM Distributor パッケージを使用して、Windowsインスタンスに Amazon Inspector SSM プラグインをインストールします。詳細については、「の Amazon Inspector SSM プラグインについて Windows」を参照してください。
  3. InvokeInspectorSsmPlugin-do-not-delete SSM 関連付けは、Amazon Inspector SSM プラグインを定期的に実行してインスタンスデータを収集し、Amazon Inspector の検出結果を生成します。デフォルトでは、この間隔は 6 時間ごとです。ただし、SSM を使用して関連付けに cron 式または rate 式を設定することで、これをカスタマイズできます。詳細については、「AWS Systems Manager ユーザーガイド」の「リファレンス: Systems Manager の Cron 式および rate 式」を参照してください。

こちらは、Windows OS の EC2 インスタンスに対して、Amazon Inspector を実行するために必要な Amazon Inspector SSM プラグインインストールやスキャンを行っています。
しかしながら対象の EC2 インスタンスが例えば、Red Hat Enterprise Linux Server といった Linux OS の場合、ステータスの詳細が : InvalidPlatform となり、ログ上では standardError": "" と表示されているとご認識ください。

https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/monitor-commands.html

InvalidPlatform コマンドは、選択したドキュメントで指定された必須プラットフォームと一致しないマネージノードに送信されました。

無題

なお、amazon-ssm-agent.log には以下のような Amazon Inspector に関連する出力がございます。

amazon-ssm-agent.log での出力例
2024-08-06 04:34:26 INFO [ssm-agent-worker] [MessageService] [MGSInteractor] Sending reply {
  "additionalInfo": {
    "agent": {
      "lang": "en-US",
      "name": "amazon-ssm-agent",
      "os": "",
      "osver": "1",
      "ver": ""
    },
    "dateTime": "2024-08-06T04:34:26.854Z",
    "runId": "",
    "runtimeStatusCounts": {
      "Success": 1
    }
  },
  "documentStatus": "Success",
  "documentTraceOutput": "",
  "runtimeStatus": {
    "invokeInspectorSsmPluginLinux": {
      "status": "Success",
      "code": 0,
      "name": "aws:runShellScript",
      "output": "Failed to get instance tags from instance metadata.\nChecking the installation of inspector ssm plugin...\n/opt/aws/inspector/bin/inspectorssmplugin does not exist\nWaiting for 60 second(s) before retrying...\n/opt/aws/inspector/bin/inspectorssmplugin exist\nInspector ssm plugin is installed.\nStarting evaluation using inspector ssm plugin\nInspectorDataPath= /opt/aws/inspector/var\nInspectorInputRoot= /opt/aws/inspector/var/input\nInspectorOutputRoot= /opt/aws/inspector/var/output\nInspectorLogsRoot= /var/log/amazon/inspector\nInspector ssm plugin linux ran successfully\n",
      "startDateTime": "2024-08-06T04:33:23.950Z",
      "endDateTime": "2024-08-06T04:34:26.853Z",
      "outputS3BucketName": "",
      "outputS3KeyPrefix": "",
      "stepName": "",
      "standardOutput": "Failed to get instance tags from instance metadata.\nChecking the installation of inspector ssm plugin...\n/opt/aws/inspector/bin/inspectorssmplugin does not exist\nWaiting for 60 second(s) before retrying...\n/opt/aws/inspector/bin/inspectorssmplugin exist\nInspector ssm plugin is installed.\nStarting evaluation using inspector ssm plugin\nInspectorDataPath= /opt/aws/inspector/var\nInspectorInputRoot= /opt/aws/inspector/var/input\nInspectorOutputRoot= /opt/aws/inspector/var/output\nInspectorLogsRoot= /var/log/amazon/inspector\nInspector ssm plugin linux ran successfully\n",
      "standardError": ""
    }
  }
}

参考資料

この記事をシェアする

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.